package org.gis.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 */
@Entity
@Table(name = "sensori")
@NamedQueries({
    @NamedQuery(name = "Sensori.findAll", query = "SELECT s FROM Sensori s"),
    @NamedQuery(name = "Sensori.findByObjectid", query = "SELECT s FROM Sensori s WHERE s.objectid = :objectid"),
    @NamedQuery(name = "Sensori.findByGeofoni", query = "SELECT s FROM Sensori s WHERE s.geofoni = :geofoni"),
    @NamedQuery(name = "Sensori.findByTemperatura", query = "SELECT s FROM Sensori s WHERE s.temperatura = :temperatura"),
    @NamedQuery(name = "Sensori.findByAccelerometro", query = "SELECT s FROM Sensori s WHERE s.accelerometro = :accelerometro"),
    @NamedQuery(name = "Sensori.findByNome", query = "SELECT s FROM Sensori s WHERE s.nome = :nome")})
public class Sensori implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "OBJECTID")
    private Integer objectid;
    @Basic(optional = false)
    @Lob
    @Column(name = "SHAPE")
    private byte[] shape;
    @Basic(optional = false)
    @Column(name = "Geofoni")
    private float geofoni;
    @Basic(optional = false)
    @Column(name = "Temperatura")
    private short temperatura;
    @Basic(optional = false)
    @Column(name = "Accelerometro")
    private float accelerometro;
    @Basic(optional = false)
    @Column(name = "Nome")
    private String nome;

    public Sensori() {
    }

    public Sensori(Integer objectid) {
        this.objectid = objectid;
    }

    public Sensori(Integer objectid, byte[] shape, float geofoni, short temperatura, float accelerometro, String nome) {
        this.objectid = objectid;
        this.shape = shape;
        this.geofoni = geofoni;
        this.temperatura = temperatura;
        this.accelerometro = accelerometro;
        this.nome = nome;
    }

    public Integer getObjectid() {
        return objectid;
    }

    public void setObjectid(Integer objectid) {
        this.objectid = objectid;
    }

    public byte[] getShape() {
        return shape;
    }

    public void setShape(byte[] shape) {
        this.shape = shape;
    }

    public float getGeofoni() {
        return geofoni;
    }

    public void setGeofoni(float geofoni) {
        this.geofoni = geofoni;
    }

    public short getTemperatura() {
        return temperatura;
    }

    public void setTemperatura(short temperatura) {
        this.temperatura = temperatura;
    }

    public float getAccelerometro() {
        return accelerometro;
    }

    public void setAccelerometro(float accelerometro) {
        this.accelerometro = accelerometro;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (objectid != null ? objectid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Sensori)) {
            return false;
        }
        Sensori other = (Sensori) object;
        if ((this.objectid == null && other.objectid != null) || (this.objectid != null && !this.objectid.equals(other.objectid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.gis.entities.Sensori[objectid=" + objectid + "]";
    }

}
